package com.fivetalks.client;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class GateActivity extends Activity implements OnClickListener {

	Button loginButton;
	Button joinButton;
	Intent intent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_gate);

		loginButton = (Button) findViewById(R.id.bt_login);
		joinButton = (Button) findViewById(R.id.bt_join);

		// 버튼 객체 생성

		loginButton.setOnClickListener(this);
		joinButton.setOnClickListener(this);

		// 객체에 Listener를 부여함

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_gate, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.bt_login:
			Toast.makeText(this, "Log In", Toast.LENGTH_SHORT).show();

			intent = new Intent(this, LoginFormActivity.class);
			startActivity(intent);

			break;
		case R.id.bt_join:
			Toast.makeText(this, "Join", Toast.LENGTH_SHORT).show();
			intent = new Intent(this, JoinFormActivity.class);
			startActivity(intent);
			break;
		}
	}
}
